home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 May: Tool Chest / Dev.CD May 97 TC.toast / Sample Code / Toolbox / MacCalendar 1.1b1 / MacCalendarCommon.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-20  |  4.1 KB  |  123 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        MacCalendarCommon.h
  3.  
  4.     Contains:    Definitions common to the application and control strip module.
  5.  
  6.     Written by:    Martin Minow
  7.  
  8.     Copyright:    © 1994-1997 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.     You may incorporate this sample code into your applications without
  13.     restriction, though the sample code has been provided "AS IS" and the
  14.     responsibility for its operation is 100% yours.  However, what you are
  15.     not permitted to do is to redistribute the source as "DSC Sample Code"
  16.     after having made changes. If you're going to re-distribute the source,
  17.     we require that you make it clear in the source that the code was
  18.     descended from Apple Sample Code, but that you've made changes.
  19.  
  20.     Edit History:
  21.         1.0d0    MM    First "public" distribution.
  22.         1.0d1    MM    Added the setup application.
  23.         1.0d2    MM    Added balloon help to the setup dialog. Added a "can't
  24.                     find preference file alert." No substantive changes.
  25.         1.0d3    MM    Some small fixes from the Status Bar author. Now hiliting
  26.                     the days of the week and today's date if shown.
  27.         1.0d4    MM    Revised to use the current ControlStrip header file. Removed
  28.                     references to a local copy of Icons.h as the Universal Header
  29.                     distribution has this information. Shrunk next/last month buttons.
  30.                     Make a copy of the intlHdl so we don't change the system info.
  31.         1.0d5    MM    Bug displaying October 1994 - blank first line.
  32.         1.0d6    MM    Redid drawing routine.
  33. */
  34.  
  35. #ifndef __MACCALENDARCOMMON__
  36. #define __MACCALENDARCOMMON__
  37.  
  38. #define  SystemSevenFiveOrLater    1
  39. #define  OLDROUTINELOCATIONS    0
  40. #define  OLDROUTINENAMES        0
  41. #define  DEBUG                    1
  42.  
  43. #define kSetupAppCreator        'SCCF'
  44. #define kControlStripCreator    'SCAL'
  45.  
  46. #define kVersionMajor        1
  47. #define kVersionMinor        0x10        // minor and bugfix share a single byte as BCD
  48. #define kVersionStage        beta
  49. #define kVersionRelease        1
  50. #define kVersionIdent        "1.1b1"
  51. #define kVersionString        "1.1b1 © 1994-97 Apple Computer, Inc."
  52.  
  53. #define kFirstIsSunday        1
  54. #define kFirstIsMonday        2
  55.  
  56. #define    kDefaultFontStr        "Geneva"
  57. #define kDefaultSizeStr        "9"
  58. #define kDefaultFirstDayStr    "1"
  59. #define kDefaultDayNamesStr    "\001S\001M\002Tu\001W\002Th\001F\001S\000"
  60.  
  61. #ifndef REZ
  62.  
  63. #include <Types.h>
  64.  
  65. #ifndef FALSE
  66. #define FALSE                0
  67. #define TRUE                1
  68. #endif
  69.  
  70. // Some macros that I just couldn't get rid of -- Quinn
  71.  
  72. #define width(rect)            ((rect).right - (rect).left)
  73. #define height(rect)        ((rect).bottom - (rect).top)
  74. #define PicFrame(what)        ((**(*globalPtr).what).picFrame)    /* The picture frame rectangle    */
  75.  
  76. #define pstrcpy(dst, src)    (BlockMoveData((src), (dst), (src)[0] + 1))
  77.  
  78. #if DEBUG
  79.     #define QAssert(mustBeTrue)    if (mustBeTrue) { } else { Debugger(); }
  80. #else
  81.     #define QAssert
  82. #endif
  83.  
  84. /*
  85.  * This is saved across restarts - it is set from "factory settings" if no
  86.  * preference resource is found in the Status Bar preference file, and can
  87.  * be changed by the MacCalendarSetup application.
  88.  *
  89.  * This structure is also published via Gestalt by the control strip module.
  90.  * Because it's shared between 68K code (the module) and PPC code (the
  91.  * PPC version of the setup application), this structure must be declared
  92.  * using a standard alignment, in this case 68K.
  93.  */
  94.  
  95. #if PRAGMA_ALIGN_SUPPORTED
  96. #pragma options align=mac68k
  97. #endif
  98.  
  99. typedef struct SavedSettings {
  100.     OSType            signature;                    /* Our signature                    */
  101.     OSType            prefVersion;                /* Preference revision level        */                
  102.     UInt32            modCount;                    /* Change this to force module to notice changes in the remaining fields */                
  103.     Str255            dayNameString;                /* Current date label string        */
  104.     Str255            fontName;                    /* Requested display font            */
  105.     short            fontSize;                    /* Display font size                */
  106.     short            firstDayOfWeek;                /* Sunday == 1                        */
  107. } SavedSettings, **SavedSettingsHandle;
  108.  
  109. #if PRAGMA_ALIGN_SUPPORTED
  110. #pragma options align=reset
  111. #endif
  112.  
  113. /*
  114.  * The value of kPrefVersion has no special significance. It should be changed
  115.  * whenever the SavedSettings resource is changed, or whenever it you desire to
  116.  * redefine the SavedSettings resource (for example, during debugging).
  117.  */
  118. #define kPrefVersion        ('1004')            /* Change this to rebuild pref's    */
  119.  
  120. #endif /* REZ */
  121.  
  122. #endif /* __MACCALENDARCOMMON__ */
  123.